<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE);
session_start();

$img = isset($_POST['imgupload_file_data'])? $_POST['imgupload_file_data'] : '';  

//echo $img;exit;
// 获取图片  
list($type, $data) = explode(',', $img);  


// 判断类型  
if(strstr($type,'image/jpeg')!==''){  
  $ext = '.jpg';
}elseif(strstr($type,'image/gif')!==''){  
  $ext = '.gif';
}elseif(strstr($type,'image/png')!==''){  
  $ext = '.png';
}

// 生成的文件名  
$photo = time().$ext; 
//$photo = $_POST['match_photo_upload_description'].$ext; 
//echo $photo;
//echo $data;exit;
// 生成文件  
file_put_contents($photo, base64_decode($data), true);



//echo "./club/demo/" . $photo;

?>
{	
	"status": 1,
	"msg": "<?php echo "./demo/" . $photo; ?>"
}